|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfurny.ga.FurnLayoutIndividual
public final class FurnLayoutIndividual
Individual for furniture layouts. This supports clustering, interval fitness, cost info output and debug infos.
Field Summary | |
---|---|
private GAContext |
context
The GA context is always required. |
private double |
fitnessCenter
|
private double |
fitnessMax
|
private double |
fitnessMin
|
private FurnEntryList |
furnitures
List of furniture entries. |
private long |
id
|
private static java.util.concurrent.atomic.AtomicLong |
ID_GENERATOR
Generator for unique ids. |
private static java.util.Random |
rnd
|
Fields inherited from interface ga.core.individual.IFitness |
---|
UNEVALUATED |
Constructor Summary | |
---|---|
FurnLayoutIndividual()
Creates a new individual. |
|
FurnLayoutIndividual(GAContext context)
Creates a new individual using the given context. |
Method Summary | |
---|---|
FurnLayoutIndividual |
centroidOf(java.util.Collection<FurnLayoutIndividual> c)
|
FurnLayoutIndividual |
clone()
Creates a new individual that is equal to this. |
double |
distanceFrom(FurnLayoutIndividual ind2)
Calculates the distance from this individual to the second individual, normalized to [0;1]. |
boolean |
equals(java.lang.Object obj)
|
GAContext |
getContext()
Getter for the GA context. |
double |
getCosts()
Get the costs as double. |
java.lang.String |
getCostString()
Get the textual representation of the costs. |
java.lang.String |
getDebugString()
Get the debug string of the individual. |
double |
getFitness()
Getter for the fitness of the individual. |
double |
getFitnessWidth()
Getter for the fitness width (max-min). |
FurnEntryList |
getFurnitures()
Getter for the genotype of the individual. |
java.lang.String |
getGenotypeString()
Get a string representation of the genotype. |
long |
getId()
Getter for the unique id. |
java.lang.String |
getIdString()
Get a string of the id. |
double |
getMaxFitness()
Getter for the maximum fitness. |
double |
getMinFitness()
Getter for the minimum fitness. |
long[][] |
getSimpleGenotype()
Getter for the simple genotype. |
int |
hashCode()
|
void |
initRandomly()
Initializes the genotype randomly and resets the fitness. |
boolean |
isEvaluated()
Determines if the individual has been evaluated. |
void |
setContext(GAContext context)
Sets the GA context. |
void |
setFitness(double fitness)
Setter for the fitness of the individual. |
void |
setFitnessInterval(double center,
double width)
Sets the fitness interval by its center and width. |
void |
setFitnessLimits(double min,
double max)
Sets the fitness interval by its minimum and maximum. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static java.util.Random rnd
private static final java.util.concurrent.atomic.AtomicLong ID_GENERATOR
private final long id
private final FurnEntryList furnitures
private double fitnessCenter
private double fitnessMin
private double fitnessMax
private GAContext context
Constructor Detail |
---|
public FurnLayoutIndividual(GAContext context)
context
- The GA context.public FurnLayoutIndividual()
Method Detail |
---|
public void setContext(GAContext context)
IIndividual
setContext
in interface IIndividual<FurnLayoutIndividual>
context
- The contextpublic GAContext getContext()
IIndividual
getContext
in interface IIndividual<FurnLayoutIndividual>
public long getId()
IIndividual
getId
in interface IIndividual<FurnLayoutIndividual>
public void setFitness(double fitness)
IFitness
setFitness
in interface IFitness
fitness
- The fitness.public double getFitness()
IFitness
getFitness
in interface IFitness
public double getMaxFitness()
IIntervalFitness
getMaxFitness
in interface IIntervalFitness
public double getMinFitness()
IIntervalFitness
getMinFitness
in interface IIntervalFitness
public double getFitnessWidth()
IIntervalFitness
getFitnessWidth
in interface IIntervalFitness
public void setFitnessInterval(double center, double width)
IIntervalFitness
setFitnessInterval
in interface IIntervalFitness
center
- Center of the fitness interval.width
- The width of the fitness interval.public void setFitnessLimits(double min, double max)
IIntervalFitness
setFitnessLimits
in interface IIntervalFitness
min
- Minimum fitness.max
- Maximum fitness.public void initRandomly()
IIndividual
initRandomly
in interface IIndividual<FurnLayoutIndividual>
public FurnEntryList getFurnitures()
public long[][] getSimpleGenotype()
long
numbers.
public boolean isEvaluated()
IIndividual
isEvaluated
in interface IIndividual<FurnLayoutIndividual>
true
if the individual is evaluated.public FurnLayoutIndividual clone()
IIndividual
clone
in interface IIndividual<FurnLayoutIndividual>
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getDebugString()
IDebugInfo
getDebugString
in interface IDebugInfo
public java.lang.String getIdString()
IDebugInfo
getIdString
in interface IDebugInfo
public double getCosts()
ICostInfo
getCosts
in interface ICostInfo
public java.lang.String getCostString()
ICostInfo
getCostString
in interface ICostInfo
public java.lang.String getGenotypeString()
IDebugInfo
getGenotypeString
in interface IDebugInfo
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public FurnLayoutIndividual centroidOf(java.util.Collection<FurnLayoutIndividual> c)
centroidOf
in interface org.apache.commons.math.stat.clustering.Clusterable<FurnLayoutIndividual>
public double distanceFrom(FurnLayoutIndividual ind2)
IClusterableIndividual
distanceFrom
in interface IClusterableIndividual<FurnLayoutIndividual>
distanceFrom
in interface org.apache.commons.math.stat.clustering.Clusterable<FurnLayoutIndividual>
ind2
- The second individual
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |